# Contributor: Will Sinatra <wpsinatra@gmail.com>
# Maintainer: Will Sinatra <wpsinatra@gmail.com>
pkgname=py3-vt-py
pkgver=0.18.2
pkgrel=0
pkgdesc="Official Python client library for VirusTotal's REST API"
url="https://github.com/virustotal/vt-py"
license="Apache-2.0"
arch="noarch"
makedepends="py3-build py3-installer py3-setuptools py3-wheel py3-sphinx"
checkdepends="py3-pytest-asyncio py3-pytest-httpserver"
depends="py3-aiohttp"
source="$pkgname-$pkgver.tar.gz::https://github.com/VirusTotal/vt-py/archive/refs/tags/$pkgver.tar.gz"
subpackages="$pkgname-pyc $pkgname-doc"
builddir="$srcdir/vt-py-$pkgver"

build() {
	python3 -m build --wheel --skip-dependency-check --no-isolation
	sphinx-build -b man docs/source _build
}

check() {
	python3 -m venv --system-site-packages test-env
	test-env/bin/python -m installer dist/*.whl
	test-env/bin/python -m pytest
}

package() {
	python3 -m installer --destdir="$pkgdir" dist/*.whl
	install -Dm644 "_build/vt-py.1" -t "$pkgdir/usr/share/man/man1/"
}

sha512sums="
ed908921426f5a9551a54281c55d66fbed4670098afaeaaf5585f2005fd4fa98e39d6cfcfda62196609f3c199d22b782c8f6709285a2622841919c51f114cd74  py3-vt-py-0.18.2.tar.gz
"
